/**
 * @file rank/popularize/luogu1464/main.cpp
 * @brief
 * @see
 * @author Ruiming Guo (guoruiming@stu.scu.edu.cn)
 * @copyright 2022
 * @date 2022/7/10 18:54:33
 **/

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
const int N = 25;
ll memo[N][N][N];  // memo[a][b][c]
bool vis[N][N][N];
ll w(ll a, ll b, ll c) {
  ll ans;
  if (a <= 0 || b <= 0 || c <= 0)
    ans = 1;
  else if (a > 20 || b > 20 || c > 20)
    ans = w(20, 20, 20);
  else {
    if (vis[a][b][c]) {
      ans = memo[a][b][c];
    } else {
      vis[a][b][c] = true;
      if (a < b && b < c)
        ans = memo[a][b][c] =
            w(a, b, c - 1) + w(a, b - 1, c - 1) - w(a, b - 1, c);
      else
        ans = memo[a][b][c] = w(a - 1, b, c) + w(a - 1, b - 1, c) +
                              w(a - 1, b, c - 1) - w(a - 1, b - 1, c - 1);
    }
  }

  return ans;
}
int main() {
  // High rating and good luck!
  int a, b, c;
  while (scanf("%d%d%d", &a, &b, &c) == 3) {
    if (a == -1 && b == -1 && c == -1) break;
    printf("w(%d, %d, %d) = %lld\n", a, b, c, w(a, b, c));
  }
  return 0;
}
